home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1996
/
MacHack 1996.toast
/
Hacks
/
Hacks ’92
/
Scroll O Rama
/
CallBack.ƒ
/
Scroll Call Back.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-07-10
|
786b
|
38 lines
/* This is the source code for the SBCB code resource used by the scroll */
/* bars in SBar.c. There isn't anything special about the routine, it */
/* just has to be stored as a code resource so that it can be loaded by */
/* cdev. */
#define DelayTime 9
pascal void main(ControlHandle theControl, int theCode)
{
int theCV, maxCV, minCV;
long dummy;
maxCV = GetCtlMax(theControl);
theCV = GetCtlValue(theControl);
minCV = GetCtlMin(theControl);
switch(theCode)
{
case inPageDown:
case inDownButton:
if (theCV < maxCV)
{
theCV += 1;
Delay(DelayTime, &dummy);
}
break;
case inPageUp:
case inUpButton:
if (theCV > minCV)
{
theCV -= 1;
Delay(DelayTime, &dummy);
}
}
SetCtlValue(theControl, theCV);
}